.class public Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;
.super Lcom/bitauto/autoeasy/BaseListActivity;
.source "CarSummaryActivity.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity$BrandTypeTask;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/bitauto/autoeasy/BaseListActivity;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# instance fields
.field private final TAG:Ljava/lang/String;

.field private arrayList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;",
            ">;"
        }
    .end annotation
.end field

.field private brandType:Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

.field private hashMap:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;",
            ">;>;"
        }
    .end annotation
.end field

.field private listView:Landroid/widget/ListView;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 28
    invoke-direct {p0}, Lcom/bitauto/autoeasy/BaseListActivity;-><init>()V

    .line 36
    const-string v0, "CarSummaryActivity"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->TAG:Ljava/lang/String;

    .line 28
    return-void
.end method

.method static synthetic access$0(Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;)Lcom/bitauto/autoeasy/selectcar/Object/BrandType;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->brandType:Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

    return-object v0
.end method


# virtual methods
.method public DownLoadData()V
    .locals 5

    .prologue
    .line 52
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/BrandTypeParser;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "http://m.bitauto.com/iphoneapi/v2/getcartypelist/?carid="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->getIntent()Landroid/content/Intent;

    move-result-object v2

    const-string v3, "carid"

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Object/BrandTypeParser;-><init>(Ljava/lang/String;)V

    .line 53
    .local v0, bParser:Lcom/bitauto/autoeasy/selectcar/Object/BrandTypeParser;
    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/BrandTypeParser;->Paser2Object()Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

    move-result-object v1

    iput-object v1, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->brandType:Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

    .line 54
    return-void
.end method

.method public initView()V
    .locals 1

    .prologue
    .line 47
    const v0, 0x7f03002a

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->setContentView(I)V

    .line 48
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->getListView()Landroid/widget/ListView;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->listView:Landroid/widget/ListView;

    .line 49
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    .line 40
    invoke-super {p0, p1}, Lcom/bitauto/autoeasy/BaseListActivity;->onCreate(Landroid/os/Bundle;)V

    .line 42
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->initView()V

    .line 43
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity$BrandTypeTask;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity$BrandTypeTask;-><init>(Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;)V

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/String;

    const/4 v2, 0x0

    const-string v3, ""

    aput-object v3, v1, v2

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity$BrandTypeTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 44
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 4
    .parameter
    .parameter "view"
    .parameter "position"
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 80
    .local p1, parent:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    if-eqz v2, :cond_0

    .line 81
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    invoke-virtual {v2, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    .line 82
    .local v0, carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;
    new-instance v1, Landroid/content/Intent;

    const-class v2, Lcom/bitauto/autoeasy/selectcar/CarTypeActivity;

    invoke-direct {v1, p0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 83
    .local v1, intent:Landroid/content/Intent;
    const-string v2, "carID"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;->getCarID()I

    move-result v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 84
    const-string v2, "carName"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;->getCarName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 85
    const-string v2, "title"

    iget-object v3, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->brandType:Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

    invoke-virtual {v3}, Lcom/bitauto/autoeasy/selectcar/Object/BrandType;->getShowName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 87
    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->startActivity(Landroid/content/Intent;)V

    .line 89
    .end local v0           #carSummary:Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;
    .end local v1           #intent:Landroid/content/Intent;
    :cond_0
    return-void
.end method

.method public refreshView()V
    .locals 7

    .prologue
    .line 57
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->brandType:Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

    invoke-virtual {v4}, Lcom/bitauto/autoeasy/selectcar/Object/BrandType;->getYearlist()Ljava/util/ArrayList;

    move-result-object v3

    .line 58
    .local v3, yearList:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->brandType:Lcom/bitauto/autoeasy/selectcar/Object/BrandType;

    invoke-virtual {v4}, Lcom/bitauto/autoeasy/selectcar/Object/BrandType;->getHashMap()Ljava/util/HashMap;

    move-result-object v4

    iput-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->hashMap:Ljava/util/HashMap;

    .line 59
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    iput-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    .line 60
    if-eqz v3, :cond_1

    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->hashMap:Ljava/util/HashMap;

    if-eqz v4, :cond_1

    .line 62
    invoke-virtual {v3}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :cond_0
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-nez v4, :cond_3

    .line 70
    :cond_1
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    if-eqz v4, :cond_2

    .line 71
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandTypeAdapter;

    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    iget-object v5, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->listView:Landroid/widget/ListView;

    invoke-direct {v0, v4, p0, v5}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandTypeAdapter;-><init>(Ljava/util/ArrayList;Landroid/content/Context;Landroid/widget/ListView;)V

    .line 72
    .local v0, bTypeAdapter:Lcom/bitauto/autoeasy/selectcar/Adapter/BrandTypeAdapter;
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v4, v0}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 73
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v4, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 75
    .end local v0           #bTypeAdapter:Lcom/bitauto/autoeasy/selectcar/Adapter/BrandTypeAdapter;
    :cond_2
    return-void

    .line 62
    :cond_3
    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 63
    .local v2, str:Ljava/lang/String;
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->hashMap:Ljava/util/HashMap;

    invoke-virtual {v4, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 64
    .local v1, it:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;>;"
    iget-object v4, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    new-instance v6, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    invoke-direct {v6, v2}, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 65
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 66
    iget-object v6, p0, Lcom/bitauto/autoeasy/selectcar/CarSummaryActivity;->arrayList:Ljava/util/ArrayList;

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/bitauto/autoeasy/selectcar/Object/CarSummary;

    invoke-virtual {v6, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_0
.end method
